﻿#ifndef COMPUTER_H
#define COMPUTER_H


#include "common.h"
#include "Logger.h"

typedef enum
{
    ComputerFromSource_autoCreateByTCP,
    ComputerFromSource_importFromDB,
    ComputerFromSource_addByManual
}ComputerFromSource;



class Computer
{
public:
    Computer();

    Computer(QString &name, int fromSource, QString &ip, QString &comment, QString apps);

    void copyBasicInfo(Computer & computer);

    bool isOffLine(QDateTime heartBeatTime);

    bool isOffLine();

    QString getOffLineState();

    //数据库数据
    long id;

    QString name;

    QString ip;

    QString comment;

    int fromSource;

    //业务数据
    int unReadALarmCount;

    QDateTime lastHeartBeatTime;

    QString apps;
};



//排列判断
bool compareComputer(const Computer &var1, const Computer &var2);


#endif // COMPUTER_H
